from selenium.webdriver.common.by import By

from demo.weworkSelenium.page.base_page import BasePage


class Matarial(BasePage):
    def add_picture(self):
        pic_btn = (By.LINK_TEXT, '图片')
        add_btn = (By.LINK_TEXT, '添加图片')
        upload_btn = (By.CSS_SELECTOR, '.material_upload_input')
        queren_btn = (By.CSS_SELECTOR, '.js_next')

        self.find(pic_btn).click()
        self.find(add_btn).click()
        self.find(upload_btn).send_keys('/Users/apple/Projects/PythonProjects/HogWords11/weworkSelenium/data/1.jpg')
        self.wait_hide(By.CSS_SELECTOR, '.js_uploadProgress_cancel')
        # print(self._driver.page_source)
        self.find(queren_btn).click()
